<?php 
defined('IN_YYS')or exit('Access Denied.');
System::DOWN_App_class('base','member','no');
System::DOWN_App_fun('my','index');
System::DOWN_App_fun('user','index');
System::DOWN_sys_fun('send');
System::DOWN_sys_fun('user');
class ajax_order extends base {
	
	public function __construct(){
		parent::__construct();
		$this->db = System::DOWN_sys_class('model');
	}
	
	public function ajax_index_order(){
		$datatype = $_REQUEST['datatype'];
		$result = $this->$datatype();
		if($result){
			$return['status'] = 1;
		}else{
			$return['status'] = 0;
		}
		$return['list'] = $result;
		echo json_encode($return);
	}
	
	private function orderlist(){
		$uid = $this->userinfo['uid'];
		$status = intval($_REQUEST['status']);
		if($status != 9){
			$where = " and `status` = '$status'";
		}
		$time = time();
		$count = $this->db->YCount("select * from `@#_order_list` where `is_delete` = '0' and `uid` = '$uid' and `is_zhongchou` = '0'  $where");
		$fenye = System::DOWN_sys_class('page');
		if(isset($_GET['p'])){$fenyenum=$_GET['p'];}else{$fenyenum=1;}	
		$fenye->config($count,10,$fenyenum,"0");		
		$lists = $this->db->YPage("select * from `@#_order_list` where `is_delete` = '0' and `uid` = '$uid' and `is_zhongchou` = '0' $where ORDER BY `id` DESC",array("num"=>10,"page"=>$fenyenum,"type"=>1,"cache"=>0));		
		$list = array();
		$goods_list = array();
		foreach($lists as $key => $one){
			$totalNum = 0;
			$goods_list = $this->db->YList("select * from `@#_order_item` where `order_sn` = '$one[order_sn]'");
			foreach($goods_list as $k => $o){
				$goods_list[$k]['goods_name'] = html_entity_decode($o['goods_name']);
				$totalNum += $o['number'];
			}
			$list[$key]['goods'] = $goods_list;
			$supplier = $this->db->YOne("select * from `@#_supplier` where `id` = '$one[supplier_id]'");
			$list[$key]['supplierName'] = $supplier['name'];
			$list[$key]['supplierId'] = $supplier['id'];
			$one['totalNum'] = $totalNum;
			$list[$key]['order'] = $one;
		}
		return $list;
	}
	
	
	
	
	
	/*
	$list = array();
		$goods_list = array();
		if($lists){
			foreach($lists as $key => $one){
				$totalMoney = 0;
				/*整理商品*
				$goods_lists = $this->db->YList("select * from `@#_order_item` where `order_sn` = '$one[order_sn]' order by `id` desc");
				
				/*以商户构造订单*
				foreach($goods_lists as $k => $o){
					$o['goods_name'] = html_entity_decode($o['goods_name']);
					if($o['express']){
						$o['express'] = '包邮';
					}else{
						$o['express'] = '自提';
					}
					$list[$one['order_sn']][$o['supplier_id']]['goods'][] = $o;
					$totalMoney += $o['total_money'];
				}
				$list[$one['order_sn']]['is_delete'] = $one['is_delete'];
				$list[$one['order_sn']]['status'] = $one['status'];
			}
		}
		
		/*补入商户信息*
		foreach($list as $key => $one){
			foreach($one as $k => $o){
				if(is_array($o)){
					$supplier = $this->db->YOne("select * from `@#_supplier` where `id` = '$k'");
					$list[$key][$k]['supplierName'] = $supplier['name'];
					$totalMoney = 0;
					$totalNum = 0;
					foreach($o['goods'] as $e => $g){
						$totalMoney += $g['total_price'];
						$totalNum += $g['number'];
					}
					$list[$key][$k]['totalMoney'] = $totalMoney;
					$list[$key][$k]['totalNum'] = $totalNum;
					$list[$key][$k]['is_delete'] = $list[$key]['is_delete'];
					$list[$key][$k]['status'] = $list[$key]['status'];
				}
			}
			unset($list[$key]['is_delete']);
			unset($list[$key]['status']);
		}
		// echo "<pre>";
		// print_r($list);
		// die();
		/*以商户构造订单*/
		/*$supplierArray = array();
		foreach($list as $key => $one){
			if(!in_array($one['code'],$supplierArray)){
				$supplierArray[] = $one['code'];
			}
		}
		
		
		/*梳理商户*
		$supplierArray = array();
		foreach($list as $key => $one){
			if(!in_array($one['code'],$supplierArray)){
				$supplierArray[] = $one['code'];
			}
		}
		
		$new_data = array();
		foreach($list as $key => $one){
			/*构造*
			$new_data[$one['code']]['supplierName'] = getSupplierInfo($one['supplierId'],'name');
			if($one['pay_status'] == 0){
				$new_data[$one['code']]['pay_msg'] = '待买家付款';
			}elseif($one['pay_status'] == 1){
				$new_data[$one['code']]['pay_msg'] = '待卖家发货';
			}elseif($one['pay_status'] == 2){
				$new_data[$one['code']]['pay_msg'] = '卖家已发货';
			}elseif($one['pay_status'] == 3){
				$new_data[$one['code']]['pay_msg'] = '交易成功';
			}

			if($one['is_delete'] == 1){
				$new_data[$one['code']]['order_delete'] = '订单已取消';
			}else{
				$new_data[$one['code']]['order_delete'] = '取消订单';
			}
			$new_data[$one['code']]['is_delete'] = $one['is_delete'];
			if($one['isfreepost']){
				$one['express'] = '包邮';
			}else{
				$one['express'] = '自有';
			}
			$new_data[$one['code']]['sid'] = $one['id'];
			$new_data[$one['code']]['code'] = $one['code'];
			$new_data[$one['code']]['totalMoney'] += $one['totalMoney'];
			$new_data[$one['code']]['goods'][] = $one;
		}*/
	
	
	
	
	
	/*private function orderlist(){
		$uid = $this->userinfo['uid'];
		$status = intval($_REQUEST['status']);
		if($status != 9){
			$where = " and `status` = '$status'";
		}
		$time = time();
		$count = $this->db->YCount("select * from `@#_order_list` where `uid` = '$uid' $where");
		//$count = $this->db->YCount("select s.*,y.is_delete,y.id,y.code,y.buy_type,y.buy_color as gid from `@#_zg_shangpin` as s left join `@#_zg_yonghu_yys_record` as y on s.id = y.shopid where y.`uid` = '$uid' $where group by y.`code`");
		$fenye = System::DOWN_sys_class('page');
		if(isset($_GET['p'])){$fenyenum=$_GET['p'];}else{$fenyenum=1;}	
		$fenye->config($count,10,$fenyenum,"0");		
		$list = $this->db->YPage("select s.*,y.is_delete,y.totalMoney,y.code,y.gonumber,y.code,y.status,y.id as gid,y.buy_type,y.buy_color from `@#_zg_shangpin` as s left join `@#_zg_yonghu_yys_record` as y on s.id = y.shopid where y.`uid` = '$uid' $where group by y.`code` ORDER BY y.`id` DESC",array("num"=>10,"page"=>$fenyenum,"type"=>1,"cache"=>0));		
		
		/*梳理商户*
		$supplierArray = array();
		foreach($list as $key => $one){
			if(!in_array($one['code'],$supplierArray)){
				$supplierArray[] = $one['code'];
			}
		}
		
		$new_data = array();
		foreach($list as $key => $one){
			/*构造*
			$new_data[$one['code']]['supplierName'] = getSupplierInfo($one['supplierId'],'name');
			if($one['pay_status'] == 0){
				$new_data[$one['code']]['pay_msg'] = '待买家付款';
			}elseif($one['pay_status'] == 1){
				$new_data[$one['code']]['pay_msg'] = '待卖家发货';
			}elseif($one['pay_status'] == 2){
				$new_data[$one['code']]['pay_msg'] = '卖家已发货';
			}elseif($one['pay_status'] == 3){
				$new_data[$one['code']]['pay_msg'] = '交易成功';
			}

			if($one['is_delete'] == 1){
				$new_data[$one['code']]['order_delete'] = '订单已取消';
			}else{
				$new_data[$one['code']]['order_delete'] = '取消订单';
			}
			$new_data[$one['code']]['is_delete'] = $one['is_delete'];
			if($one['isfreepost']){
				$one['express'] = '包邮';
			}else{
				$one['express'] = '自有';
			}
			$new_data[$one['code']]['sid'] = $one['id'];
			$new_data[$one['code']]['code'] = $one['code'];
			$new_data[$one['code']]['totalMoney'] += $one['totalMoney'];
			$new_data[$one['code']]['goods'][] = $one;
		}
		return $new_data;
	}
	
		*/
	
	/*完善地址*
	private function orderlist(){
		$uid = $this->userinfo['uid'];
		$time = time();
		$count = $this->db->YCount("select s.*,y.id as gid from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId = '0' and s.`q_end_time` <= '$time'");
		$fenye = System::DOWN_sys_class('page');
		if(isset($_GET['p'])){$fenyenum=$_GET['p'];}else{$fenyenum=1;}	
		$fenye->config($count,10,$fenyenum,"0");		
		$list = $this->db->YPage("select s.*,y.code,y.status,y.id as gid from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId = '0' and s.`q_end_time` <= '$time' ORDER BY y.`id` DESC",array("num"=>10,"page"=>$fenyenum,"type"=>1,"cache"=>0));		
		foreach($list as $key => $one){
			$order = $this->db->Yone("select * from `@#_yonghu_yys_record` where `huode` = '$one[q_user_code]' and `uid` = '$uid' and `shopid` = '$one[id]'");
			$list[$key]['order_id'] = $order['id'];
			$list[$key]['time'] = date('Y-m-d H:i:s',$one['q_end_time']);
			$status = explode(',',$one['status']);
			/*
			*	1为未发货，2为已发货
			*
			if($one['addressId'] && in_array('已发货',$status)){
				$list[$key]['express'] = '2';
			}elseif($one['addressId'] && in_array('未发货',$status)){
				$list[$key]['express'] = '1';
			}elseif(in_array('未提交地址',$status)){
				$list[$key]['express'] = '0';
			}
		}	
		return $list;
	}*/
	
	/*等待发货*/
	private function wait_send(){
		$uid = $this->userinfo['uid'];
		$count = $this->db->YCount("select s.* from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId != '0' and !FIND_IN_SET('已完成',`status`)");
		$fenye = System::DOWN_sys_class('page');
		if(isset($_GET['p'])){$fenyenum=$_GET['p'];}else{$fenyenum=1;}	
		$fenye->config($count,10,$fenyenum,"0");	
		$list = $this->db->YPage("select s.*,y.company_code,y.company,y.addressId,y.status,y.code from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId != '0' and !FIND_IN_SET('已完成',`status`) ORDER BY y.`id` DESC",array("num"=>10,"page"=>$fenyenum,"type"=>1,"cache"=>0));		
		foreach($list as $key => $one){
			$order = $this->db->Yone("select * from `@#_yonghu_yys_record` where `huode` = '$one[q_user_code]' and `uid` = '$uid' and `shopid` = '$one[id]'");
			$list[$key]['order_id'] = $order['id'];
			$list[$key]['time'] = date('Y-m-d H:i:s',$one['q_end_time']);
			/*
			*	1为未发货，2为已发货
			*/
			$status = explode(',',$one['status']);
			if($order['addressId'] && in_array('已发货',$status)){
				$list[$key]['express'] = '2';
			}elseif($order['addressId'] && in_array('未发货',$status)){
				$list[$key]['express'] = '1';
			}elseif(in_array('未提交地址',$status)){
				$list[$key]['express'] = '0';
			}
		}
		return $list;
	}
	
	/*收货评价*/
	private function evaluation(){
		$uid = $this->userinfo['uid'];
		$count = $this->db->YCount("select s.*,y.comment_id from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId != '0' and FIND_IN_SET('已完成',`status`)");
		$fenye = System::DOWN_sys_class('page');
		if(isset($_GET['p'])){$fenyenum=$_GET['p'];}else{$fenyenum=1;}	
		$fenye->config($count,10,$fenyenum,"0");		
		$list = $this->db->YPage("select s.*,y.comment_id,y.company_code,y.company,y.code from `@#_shangpin` as s left join `@#_yonghu_yys_record` as y on s.id = y.shopid where y.`huode` = s.`q_user_code` and s.`q_uid` = '$uid' and y.addressId != '0' and FIND_IN_SET('已完成',`status`) ORDER BY `id` DESC",array("num"=>10,"page"=>$fenyenum,"type"=>1,"cache"=>0));		
		foreach($list as $key => $one){
			$order = $this->db->Yone("select * from `@#_yonghu_yys_record` where `huode` = '$one[q_user_code]' and `uid` = '$uid' and `shopid` = '$one[id]'");
			$list[$key]['order_id'] = $order['id'];
			$list[$key]['time'] = date('Y-m-d H:i:s',$one['q_end_time']);
			$list[$key]['express'] = 4;
		}	
		return $list;
	}
	
	/*确认收货*/
	public function doReciveOrder(){
		$uid = $this->userinfo['uid'];
		$order_sn = $_REQUEST['code'];
		$orderInfo = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn'");
		if(!$order_sn || !$orderInfo){
			$status = 0;
			$msg = '不存在这个订单';
		}else{
			$myfile = fopen("ctest.txt", "a");
			fwrite($myfile,"当前时间".microtime(true)." order_sn：$order_sn is_conduct：".$orderInfo['is_conduct']."\n");
			$status = $orderInfo['status'];
			if($status == 3){
				$status = 0;
				$msg = '已经确认过了';
			}else if($orderInfo['is_conduct'] != 0){
				fwrite($myfile,"当前时间".microtime(true)." order_sn：$order_sn is_conduct核验未通过\n");
				$status = 0;
				$msg = '请勿重复点击确定';
			}else{
				//开始处理
				$this->db->query("update `@#_order_list` set `is_conduct` = 1 where `order_sn` = '$order_sn'");
				fwrite($myfile,"当前时间".microtime(true)." order_sn：$order_sn is_conduct核验通过，正在执行正文\n");
				$res = updateSet(array('status'=>3),'order_list',$order_sn,'order_sn');
				$res = 1;
				if($res){
					/*商户分成*/
					//$this->insertUserCoupon($order_sn);
					$this->merchantMoney($order_sn);
					sleep(3);
					$this->insertUserCoupon($order_sn);
					$status = 1;
					$msg = '确认成功';
				}else{
					$status = 0;
					$msg = '确认失败';
				}
				//结束处理
				$this->db->query("update `@#_order_list` set `is_conduct` = 2 where `order_sn` = '$order_sn'");
				fclose($myfile);
			}
		}
		echo json_encode(array('status'=>$status,'msg'=>$msg));
		exit();
	}
	
	public function doCommentOrder(){
		$uid = $this->userinfo['uid'];
		$order_sn = $_REQUEST['order_sn'];
		$praise = intval($_REQUEST['praise']);
		$orderInfo = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn'");
		if(!$order_sn || !$orderInfo){
			$status = 0;
			$msg = '不存在这个订单';
		}else{
			$content = $_REQUEST['content'];
			if(!$content){
				$status = 0;
				$msg = '请输入评论内容';
			}elseif($praise != -1 && $praise != 0 && $praise != 1 ){
				$status = 0;
				$msg = '未选择评分';
			}else{
				$order_id = $orderInfo['id'];
				$comment = $this->db->YOne("select * from `@#_comment` where `oid` = '$order_id'");
				if(!$comment){
					$data = array(
						'uid' => $uid,
						'sid' => $orderInfo['supplier_id'],
						'oid' => $order_id,
						'time' => time(),
						'content' => $content,
						'praise' => $praise,
					);
					$res = insertInto($data,'comment');
					if($res){
						updateSet(array('comment_id'=>$res,'status'=>4),'order_list',$order_id);
						if($orderInfo['supplier_id'] && $praise == 1){
							updateSet(array('credibility' => $credibility + 1),'supplier',$orderInfo['supplier_id']);
						}
						$status = 1;
						$msg = '评论成功';
					}else{
						$status = 0;
						$msg = '评论失败';
					}
				}else{
					$status = 0;
					$msg = '已经评价过了';
				}
			}
		}
		echo json_encode(array('status'=>$status,'msg'=>$msg));
		exit();
	}
	

	private function merchantMoney($order_sn){
		if(!$order_sn){
			return false;
		}else{
			$order = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn'");
			if(!$order){
				return false;
			}else{
				$status = $order['status'];
				if($status == 3){
					$order_item = $this->db->YList("select * from `@#_order_item` where `order_sn` = '$order_sn'");
					foreach($order_item as $key => $one){
						$shangpin = $this->db->YOne("select * from `@#_zg_shangpin` where `id` = '$order[shopid]'");
						$money = $one['total_price'] - $one['number'] * $one['supplierPercent'];
						$uid = $this->db->YOne("select * from `@#_supplier` where `id` = '$one[supplier_id]'");
						$user = $this->db->YOne("select * from `@#_yonghu` where `uid` = '$uid[uid]'");
						if($user){
							$uid = $user['uid'];
							$yonghu_zhanghao1 = array(
								'uid' => $user['uid'],
								'type' => '1',
								'pay' => '金币',
								'content' => '【'.$one['goods_name'].'】货款'.$money.'元',
								'money' => $money,
								'time' => time(),
								'goods_id' => $one['goods_id'],
								'goods_price' => $one['goods_price'],
								'supplier_percent' => $one['supplierPercent'],
								'goods_name' => $one['goods_name'],	
								'number' => $one['number'],
							);
							$this->db->tijiao_start();
							$re = insertInto($yonghu_zhanghao1,'yonghu_zhanghao1');
							if($re){
								$r = updateSet(array('money1'=>$user['money1']+$money),'yonghu',$uid,'uid');
								if(!$r){
									$this->db->tijiao_rollback();
									return false;
								}
							}else{
								$this->db->tijiao_rollback();
								return false;
							}
						}else{
							$this->db->tijiao_rollback();
							return false;
						}
					}
					updateSet(array('is_deal'=>1),'order_list',$order_sn,'order_sn');
					$this->db->tijiao_commit();
					return true;
				}else{
					$this->db->tijiao_rollback();
					return false;
				}
			}
		}
	}
	
	public function doCancelOrder(){
		$code = $_REQUEST['code'];
		$order = $this->db->YList("select * from `@#_order_list` where `order_sn` = '$code'");
		if($order){
			$res = updateSet(array('is_cancel'=>1,'status'=>5),'order_list',$code,'order_sn');
			if($res){
				$re = $this->orderRefund($code);
				if($re){
					$status = 1;
					$msg = '取消成功';
				}else{
					$status = 0;
					$msg = '取消失败，若未退款请联系管理员。';
				}
			}else{
				$status = 0;
				$msg = '取消失败';
			}
		}else{
			$status = 0;
			$msg = '不存在这个订单';
		}
		echo json_encode(array('status'=>$status,'msg'=>$msg));
		exit();
	}
	
	public function delOrder(){
		$code = $_REQUEST['code'];
		$order = $this->db->YList("select * from `@#_order_list` where `order_sn` = '$code'");
		if($order){
			$res = updateSet(array('is_delete'=>1,'status'=>6),'order_list',$code,'order_sn');
			if($res){
			}else{
				$status = 0;
				$msg = '删除失败';
			}
		}else{
			$status = 0;
			$msg = '不存在这个订单';
		}
		echo json_encode(array('status'=>$status,'msg'=>$msg));
		exit();
	}
	
	/*生成券yonghu_coupon*/
	public function insertUserCoupon($order_sn){
		$order = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn'");
		if(!$order){
			return false;
		}else{
			if($order['is_coupon'] == 1){
				/*购物摇券*/
				return $this->yaojiang($order_sn);
			}else{
				$order_item = $this->db->YList("select * from `@#_order_item` where `order_sn` = '$order_sn'");
				$total_money = 0;
				foreach($order_item as $key => $one){
					$total_money += $one['supplierPercent'] * $one['number'];
				}
				$yonghu_coupon = array();
				$yonghu_coupon['uid'] = $order['uid'];
				$yonghu_coupon['code'] = date('YmdHis').rand(10000,99999);
				$yonghu_coupon['password'] = substr(uniqid(),0,8);
				$yonghu_coupon['money'] = $total_money;
				$yonghu_coupon['sid'] = $order['supplier_id'];
				$yonghu_coupon['create_time'] = time();
				$yonghu_coupon['order_sn'] = $order_sn;
				$yonghu_coupon['type'] = 1;
				$res = insertInto($yonghu_coupon,'yonghu_coupon');
				if($res){
					return true;
				}else{
					return false;
				}
			}
		}
	}
	
	public function yaojiang($order_sn){
		$order = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn' and `is_randcoupon` = '0'");
		if(!$order){
			return false;
		}else{
			return $this->makeRandCoupon($order_sn);
		}
	}
	
	public function makeRandCoupon($order_sn){
		/*查询有几单*/
		$order_item = $this->db->YList("select * from `@#_order_item` where `order_sn` = '$order_sn'");
		$total_num = 0;
		foreach($order_item as $key => $one){
			$total_num += $one['number'] * $one['supplierPercent'];
		}
		$pay = System::DOWN_App_class('pay','pay');
		$pay->makeRandCoupon($order_sn,$total_num);
		$this->db->query("update `@#_order_list` set `is_randcoupon` = '1',`is_ok` = '1' where `order_sn` = '$order_sn'");
		return true;
	}
	
	private function orderRefund($order_sn){
		$order = $this->db->YOne("select * from `@#_order_list` where `order_sn` = '$order_sn'");
		if($order['is_refund'] == 1){
			return true;
		}else{
			if($order['status'] == 5 && $order['is_cancel'] == 1 && $order['is_refund'] == 0){
				/*退还金额*/
				$yonghu_zhanghao = array(
					'uid' => $order['uid'],
					'type' => 1,
					'pay' => '账户',
					'content' => '订单：'.$order_sn.'发生退款',		
					'money' => $order['total_money'],
					'time' => time(),
					'order_sn' => $order_sn
				);
				$res = insertInto($yonghu_zhanghao,'yonghu_zhanghao');
				if($res){
					$user_info = $this->db->YOne("select * from `@#_yonghu` where `uid` = '$order[uid]'");
					$user_money = $user_info['money'] + $order['total_money'];
					updateSet(array('money' => $user_money),'yonghu',$order['uid'],'uid');
					updateSet(array('is_refund' => 1),'order_list',$order['order_sn'],'order_sn');
					return true;
				}else{
					return false;
				}
			}
		}
	}
	
	
	
	/*
	*	自动执行订单商户分成
	*/
	public function autoDealOrder(){
		/*
		*	is_deal为0则为未处理过，1为已处理
		*/
		$order_list = $this->db->YList("select * from `@#_order_list` where `is_randcoupon` = '0' limit 1");
		if($order_list){
			$order = $order_list['0'];
			$this->insertUserCoupon($order['order_sn']);
			echo "执行OK";
		}
	}

		/*
		if($r){
		$money = $money * 0.05;
		$yonghu_zhanghao = array(
		'uid' => $user['uid'],
		'type' => '1',
		'pay' => '金币',
		'content' => '共赢佣金【'.$one['goods_name'].'】'.$money.'元',
		'money' => $money,
		'time' => time(),
		);
		$e = insertInto($yonghu_zhanghao,'yonghu_zhanghao');
		if($e){
		$f = updateSet(array('money'=>$user['money']+$money),'yonghu',$uid,'uid');
		if(!$f){
		$this->db->tijiao_rollback();
		return false;
		}
		}else{
		$this->db->tijiao_rollback();
		return false;
		}
		}else{
		$this->db->tijiao_rollback();
		return false;
		}
	*/
	
}